<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            height: 1000vh;
        }
    </style>
</head>

<body>
    <button id="btn">button</button>
    <script src="./node_modules/jquery/dist/jquery.js"></script>

    <script>
        let fn1 = function () {
            console.log(1)
        }
        let fn2 = function () {
            console.log(2)
        }
        let fn3 = function () {
            console.log(3)
        }
        let fn4 = function () {
            console.log(4)
        }

        // $("#btn").click(() => {
        //     fn1()
        //     fn2()
        //     fn3()
        //     fn4()
        // })
        //创建事件池
        let pond1 = $.Callbacks()
        pond1.add(fn1)
        pond1.add(fn1)
        pond1.add(fn2)
        pond1.add(fn3)
        pond1.add(fn4)
        $("#btn").click(() => {
            pond1.fire(100,200)
        })
    </script>
</body>

</html>